$OpenBSD: patch-configure_in,v 1.1 2012/11/17 14:07:50 ratchov Exp $
--- configure.in.orig	Mon May 10 20:58:57 2010
+++ configure.in	Sun Nov 11 14:39:43 2012
@@ -182,6 +182,24 @@ if test x$alsa_midi = xtrue ; then 
   CXXFLAGS="$CXXFLAGS $ALSA_CFLAGS"
 fi
 
+dnl enable disable sndio and pass it's cflags to CXXFLAGS
+AH_TEMPLATE([HAVE_SNDIO],[Determines if sndio is available on the system.])
+AC_ARG_ENABLE(sndio-midi,
+AC_HELP_STRING([--enable-sndio-midi],[compile with sndio midi support (default yes)]),
+[ case "${enableval}" in
+ yes) sndio_midi=true;;
+ no)  sndio_midi=false;;
+esac],
+[sndio_midi=true])
+if test x$sndio_midi = xtrue ; then 
+  AC_CHECK_HEADER(sndio.h,have_sndio_h=yes,)
+  AC_CHECK_LIB(sndio, sio_initpar, have_sndio_lib=yes, , )
+  if test x$have_sndio_lib = xyes -a x$have_sndio_h = xyes ; then
+    LIBS="$LIBS -lsndio"
+    AC_DEFINE(HAVE_SNDIO,1)
+  fi
+fi
+
 #Check for big endian machine, should #define WORDS_BIGENDIAN if so
 AC_C_BIGENDIAN
 
